<template>
  <div class="wholesale-list block">
    <div class="header">
      <h2 class="title">应付账单管理</h2>
      <tabs :isHiddenZero="true" :tabs-arr="tabArr" @returnIndex="handletabs" />
      <el-form ref="queryForm" :inline="true" label-position="right" :model="tableQuery">
        <el-form-item label="订单编号">
          <el-input v-model.trim="tableQuery.orderCode" type="text" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="下单时间">
          <el-date-picker
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00', '23:59:59']"
            v-model="orderDate"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>

        <el-form-item label="支付时间">
          <el-date-picker
            v-model="paymentDate"
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00', '23:59:59']"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="支付用途">
          <el-select v-model="tableQuery.payUse" clearable placeholder="请选择">
            <el-option label="货款" value="1"></el-option>
            <el-option label="押金" value="2"></el-option>
          </el-select>
        </el-form-item>
       

        <!-- <el-form-item label="汇款单号">
          <el-input v-model="tableQuery.id" type="text" placeholder="请输入" />
        </el-form-item>-->
        <el-form-item label="是否有账期">
          <el-select v-model="tableQuery.isDelayPay" clearable placeholder="请选择">
            <el-option label="有账期" value="1"></el-option>
            <el-option label="无账期" value="2"></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="收款方 ">
          <el-input v-model="tableQuery.payeeCompanyName" type="text" placeholder="请输入" />
        </el-form-item>-->
        <el-form-item label="收款方" style="margin-left:14px" v-show="collapse">
          <el-select
            v-model="tableQuery.payeeName"
            filterable
            remote
            clearable
            placeholder="请输入关键词"
            :remote-method="remoteMethod"
            :loading="loading"
          >
            <el-option
              v-for="(item,index) in options"
              :key="index"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="订单类型">
          <el-select v-model="tableQuery.orderType" clearable placeholder="请选择">
            <el-option
              v-for="item in typeList"
              :key="item.ddbm"
              :label="item.orderTypeName"
              :value="item.ddbm"
            />
          </el-select>
        </el-form-item>
        <el-form-item class="form-button">
          <el-button type="text" @click="collapse=!collapse" v-if="height_collapse">
            <span v-if="collapse">
              收起详细查询
              <i class="el-icon-arrow-up" />
            </span>
            <span v-else>
              展开详细查询
              <i class="el-icon-arrow-down" />
            </span>
          </el-button>
          <el-button type="primary" @click="queryFormQuery">查询</el-button>
          <el-button @click="queryFormReset">重置</el-button>
        </el-form-item>
        <div class="clear"></div>
      </el-form>
    </div>
    <section class="el-container container-box is-vertical">
      <div class="operate">
        <el-button type="primary" size="mini" @click="exportEx">导出</el-button>
      </div>
      <el-editable
        :data="payload.content"
        height="200"
        v-loading="tableLoading"
        :columns="columns"
        :payload="payload"
        stripe
        :needPagination="true"
        @reload="reloadProductData"
      >
        <template slot="default-orderCode" slot-scope="scope">
          <el-button type="text" @click="toDetail(scope.row)">{{scope.row.orderCode}}</el-button>
        </template>
        <!-- <template slot="default-action" slot-scope="scope">
          <el-button type="text" @click="checkDetail(scope.row)">查看</el-button>
          <el-button
            v-if="scope.row.paymentStatus === '1'"
            type="text"
            @click="toPay(scope.row)"
        >去支付</el-button>-->
        <!-- <el-button v-if="scope.row.orderStatus !== 0" type="text" @click="refund(scope.row)">退款</el-button> -->
        <!-- </template> -->
      </el-editable>
      <!-- 删除 -->
      <!-- <el-dialog
        title="申请退款"
        custom-class="dialog-custom"
        :visible.sync="delDialogVisible"
        width="40%"
      >
        <div class="text">
          <p>退款金额：</p>
          <span>{{10000.00}}</span>
        </div>
        <el-form :rules="rules" ref="ruleForm" label-width="100px">
          <el-form-item label="退款原因" prop="rule">
            <el-input
              rows="4"
              show-word-limit
              type="textarea"
              v-model="formData.rule"
              maxlength="200"
            ></el-input>
          </el-form-item>
        </el-form>
        <div class="delBtn" @click="concelDel">
          <el-button type="primary" @click="delSure">提交退款申请</el-button>

          <el-button>取消</el-button>
        </div>
      </el-dialog>-->
    </section>
  </div>
</template>

<script src="./index.js"></script>

<style lang="less" src="./index.less" scoped></style>
